package com.fast.exception;

import com.baomidou.mybatisplus.extension.api.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.net.SocketTimeoutException;

@Slf4j
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(value = SocketTimeoutException.class)
    public R SocketTimeoutExceptionHandler(SocketTimeoutException e){
        log.error("原因:{}",e.getCause());
        return R.failed("连接超时");
    }


}
